package cn.buk.tms.eotms.dao;

import cn.buk.tms.eotms.entity.*;
import cn.buk.tms.eotms.sc.SearchFlightOrderCriteria;

import java.util.List;

/**
 * @author yfdai
 */
public interface FlightOrderDao {

  /**
   * 根据查询条件查找订单
   */
  List<FlightOrder> searchOrder(final int ownerId, final int customerId, SearchFlightOrderCriteria sc);

  /**
   * 根据机票订单的id, 查找该订单包含的航班信息
   */
  List<FlightOrderFlight> searchFlightOrderFlights(int flightOrderId);

  FlightOrder getOrderById(int orderId);

  FlightOrder getOrderByOrderNo(int ownerId, String orderNo);

  int createOrder(FlightOrder info, String username);

  int createBlanketOrder(int userId, int ownerId, int customerId, FlightOrder info, List<VasOrder> subOrders, final double totalAmount);

  List<BlanketOrder> searchSubOrders(int ownerId, int blanketOrderId);

  BlanketOrder searchParentOrder(int ownerId, Integer blanketOrderId);

  /**
   * 修改机票订单为“已付款”
   * @param userId
   * @param orderId
   * @return
   */
  int updateFlightOrderPaid(int userId, int orderId);

  /**
   * 提交订单开票
   * @param userId
   * @param orderId
   * @return
   */
  int submitFlightOrder(int userId, int orderId);

  int approveFlightOrder(int ownerId, int customerId, String username, int orderId, int denyCode, String denyReason);

  /**
   * 增加机票订单的日志
   */
  void appendFlightOrderLog(int enterpriseId, int orderId, String remark);
}